﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using Ebusiness_Application;
using Microsoft.AspNetCore.Mvc;

namespace Ebusiness_HttpApi
{
    [ApiController]
    [Route("api/[controller]")]
    public class PorductMobileController : ControllerBase
    {
        /// <summary>
        /// 依赖应用层商品服务
        /// </summary>
        public IProductAppService productAppService { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public PorductMobileController(IProductAppService productAppService)
        {
            this.productAppService = productAppService;
        }

        /// <summary>
        /// 展现层 转发请求到 应用层，不做逻辑处理
        /// </summary>
        /// <param name="inserProductDto"></param>
        /// <returns></returns>
        [HttpGet]
        public ProductDto InsertProduct([FromQuery] InserProductDto inserProductDto)
        {
            productAppService.InsertProduct(inserProductDto);
            return new ProductDto();
        }
    }
}
